package com.kexio.core;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Import;

import com.kexio.core.data.DataAutoConfiguration;
import com.kexio.core.properties.CoreProperties;
import com.kexio.core.security.SecurityAutoConfiguration;
import com.kexio.core.web.WebAutoConfiguration;

/**
 * Core Starter 自动配置类
 *
 * @author Kexio Team
 * @since 1.0.0
 */
@AutoConfiguration
@Import({
    DataAutoConfiguration.class,
    SecurityAutoConfiguration.class,
    WebAutoConfiguration.class
})
@EnableConfigurationProperties(CoreProperties.class)
@ConditionalOnProperty(prefix = "kexio.core", name = "enabled", havingValue = "true", matchIfMissing = true)
public class CoreAutoConfiguration {

    private static final Logger log = LoggerFactory.getLogger(CoreAutoConfiguration.class);

    public CoreAutoConfiguration() {
        log.info("==> Kexio Core Starter 自动配置已启用");
    }
}
